cmake_minimum_required(VERSION 3.20)

project(cmake-project-2024)

if (MSVC)
    add_compile_options(/std:c++latest /experimental:module)
else()
    set(CMAKE_CXX_STANDARD 23)
    add_compile_options(-Wall -Wextra -Wpedantic -Werror)
endif()

enable_testing()

# 使用fmt库, 参考: https://github.com/fmtlib/fmt
find_package(fmt CONFIG REQUIRED)

# Google Test
find_package(GTest CONFIG REQUIRED)

# RapidJson库, 参考: https://rapidjson.org/
find_package(RapidJSON CONFIG REQUIRED)

# add coverage test
add_compile_options(-fprofile-arcs -ftest-coverage)
add_link_options(-fprofile-arcs -ftest-coverage)

add_subdirectory(src)
